<!DOCTYPE html>
<html>
<head>
    <title>{$info['name']}</title>
    <include file="appapi@head"/>
    <link href="__STATIC__/appapi/css/course.css?t=1611220006" rel="stylesheet">
</head>

<body class="body-white">
<div class="course_img">
    <img src="{$info['thumb']}">
</div>
<div class="course_tab">
    <if condition="$info['sort'] eq 1">
        <div class="course_tab_item on">介绍</div>
        <div class="course_tab_item">目录</div>
    <else/>
        <div class="course_tab_item on">详情</div>
    </if>
    <div class="course_tab_item">评价</div>
</div>
<div class="line10"></div>
<div class="course_c">
    <div class="course_title">{$info['name']} <if condition="$info['sort'] neq 1"><span>{$info['type_t']}</span></if></div>
    <div class="course_des">{$info['des']}</div>
    <div class="course_val">
        <div class="course_val_t on"><if condition="$info['paytype'] eq 1"><span>￥</span></if> <span class="on">{$info['payval']}</span></div>
        <div class="course_val_t"><if condition="$info['sort'] eq 1">{$info['lesson']}<elseif condition="$info['sort'] eq 0"/>{$info['add_time']}<else/>直播时间：{$info['lesson']}</if></div>
        <div class="course_val_t">{$info['views']}人学习</div>
    </div>
    <div class="course_teacher">
        <div class="course_teacher_t">讲师介绍</div>
        <div class="course_teacher_l clearfix">
            <ul>
                <li class="teacherbd">
                    <div class="teacherbd_img"><img src="{$info['userinfo']['avatar']}"></div>
                    <div class="teacherbd_i">
                        <div class="teacherbd_n">{$info['userinfo']['user_nickname']}</div>
                        <div class="teacherbd_t">主讲老师</div>
                    </div>
                    <div class="teacherbd_r"></div>
                </li>
                <volist name="info.tutor" id="v">
                <li class="teacherbd">
                    <div class="teacherbd_img"><img src="{$v['avatar']}"></div>
                    <div class="teacherbd_i">
                        <div class="teacherbd_n">{$v['user_nickname']}</div>
                        <div class="teacherbd_t">辅导老师</div>
                    </div>
                    <div class="teacherbd_r"></div>
                </li>
                </volist>
            </ul>
        </div>
    </div>
    <div class="course_info">
        <div class="course_info_t"><if condition="$info['sort'] gt 1">直播介绍<elseif condition="$info['sort'] eq 1"/>课程介绍<else/>内容介绍</if></div>
        <div class="course_info_c">{$info['info']}</div>
    </div>
</div>
<if condition="$info['sort'] eq 1">
<div class="course_c hide" style="padding:0;">
    <div class="lessons">
        <volist name="lessons" id="v">
        <div class="lessons_list">
            <div class="lessons_t">{$v['name']}</div>
            <div class="lessons_li">
                <ul>
                    <volist name="v.list" id="v1">
                    <li>
                        <div class="lessons_li_l"><span class="types types{$v1['type']}"></span></div>
                        <div class="lessons_li_r">
                            <div class="lessons_name">{$i}.{$v1['name']}</div>
                            <div class="lessons_time">{$v1['time_date']}</div>
                        </div>
                    </li>
                    </volist>
                </ul>
            </div>
        </div>
        </volist>
        <if condition="!$lessons">
            <div class="course_empty">
                <img src="__STATIC__/appapi/images/praise/empty.png">
                <span>还没有课时哦</span>
            </div>
        </if>
    </div>
</div>
</if>

<div class="course_c hide">
    <div class="commnet">
        <div class="commnet_t">
            <for start="0" end="$star">
            <span class="star"></span>
            </for>
            <span class="star_n">{$star}</span>
        </div>
        <div class="commnet_l">
            <ul>
                <volist name="list" id="v">
                <li>
                    <div class="commnet_l_t">
                        <div class="commnet_l_l">
                            <img src="{$v['avatar']}">
                        </div>
                        <div class="commnet_l_c">
                            <div class="commnet_l_n">{$v['user_nickname']}</div>
                            <div class="commnet_l_d">{$v['des']}</div>
                        </div>
                        <div class="commnet_l_r">
                            <div class="commnet_l_star">
                                <for start="0" end="$v['star']">
                                <span class="star"></span>
                                </for>
                            </div>
                            <div class="commnet_l_time">
                                {$v['add_time']}
                            </div>
                        </div>
                    </div>
                    <div class="commnet_l_b">{$v['content']}</div>
                </li>
                </volist>
                <if condition="!$list">
                    <div class="course_empty">
                        <img src="__STATIC__/appapi/images/praise/empty.png">
                        <span>还未收到评价</span>
                    </div>
                </if>
            </ul>
        </div>
    </div>
</div>

<div class="cart_bd">
    <if condition="$info['paytype'] eq 1">
        <div class="cart_btn">
            <img src="__STATIC__/appapi/images/share/shop_cart.png">
            <span>购物车</span>
        </div>
        <div class="cart_add">加入购物车</div>
        <div class="cart_buy">立即购买</div>
    <elseif condition="$info['sort'] neq 1"/>
        <div class="cart_d">
            <if condition="$info['sort'] gt 1">进入直播<else/>查看详情</if>
        </div>
    </if>
</div>
<include file="appapi@scripts"/>
<script>
    let code='{$code}';
    function down(){
        location.href='/appapi/share/index?code='+code;
    }
    (function (){
        $('.cart_bd').on('click',function (){
            down();
        })

        $('.course_list_c').on('click',function (){
            down();
        })

        $('.course_teacher_l').on('click',function (){
            down();
        })

        $('.lessons').on('click',function (){
            down();
        })

        $('.commnet').on('click',function (){
            down();
        })

        $('.course_tab').on('click','.course_tab_item',function (){
            let _that=$(this);
            _that.siblings().removeClass('on');
            _that.addClass('on');

            let index=_that.index();
            $('.course_c').hide().eq(index).show();
        })

    })()
</script>
</body>
</html>